export default {
  model: {
    prop: 'cur',
    event: 'change'
  },
  props: {
    size: {
      type: String,
      default: 'large'
    },
    cur: {
      type: String,
      default: ''
    },
    list: {
      type: Array,
      default: []
    }
  },
  data() {
    return {
      cursorLeft: 0
    }
  },
  computed: {
    current: {
      get() {
        return this.cur
      },
      set() {
        // noop
      }
    }
  },
  watch: {
    current() {
      this.$nextTick(() => {
        this._resetCursor()
      })
    }
  },
  mounted() {
    this._resetCursor()
  },
  methods: {
    _resetCursor() {
      return
    },
    handleClickItem(key) {
      this.current = key
      this.$emit('change', key)
      this.$emit('click', key)
    }
  }
}
